<!DOCTYPE html>
<div style="writing-mode: vertical-rl;">
    <div id="scrollable" style="width: 100px; overflow: hidden;">
        <div style="height: 100px; width: 100px; background-color: silver;"></div>
        <div id="target" style="height: 100px; width: 100px; background-color: blue;"></div>
    </div>
</div>
<p id="result">
    FAIL: Test did not run.
</p>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();

    var scrollable = document.getElementById("scrollable");
    scrollable.scrollLeft = -60;
    var target = document.getElementById("target");
    var hitContainer = document.caretRangeFromPoint(58, 100).startContainer;
    document.getElementById("result").innerText = hitContainer === target ? "PASS" : "FAIL";
</script>
